<template>
	<div>
		<el-row>
			<el-col :span="24">
				<el-card>
					<div slot="header" class="clearfix">
						<span>订单信息</span>
					</div>
					<div>
						<el-col :span="8">
							<span>订单号：</span>
							<span>{{orderDetail.order_number}}</span>
						</el-col>
						<el-col :span="8">
							<span>服务名称：</span>
							<span>{{orderDetail.goods_name}}</span>
						</el-col>
						<el-col :span="8">
							<span>用户id：</span>
							<span>{{orderDetail.uid}}</span>
						</el-col>
						<el-col :span="8">
							<span>用户名：</span>
							<span>{{orderDetail.username}}</span>
						</el-col>
						<el-col :span="8">
							<span>用户等级：</span>
							<span>{{orderDetail.grade}}</span>
						</el-col>
						<el-col :span="8">
							<span>用户电话：</span>
							<span>{{orderDetail.username}}</span>
						</el-col>
						<el-col :span="8">
							<span>商家id：</span>
							<span>{{orderDetail.company_id}}</span>
						</el-col>
						<el-col :span="8">
							<span>商家名称：</span>
							<span>{{orderDetail.name}}</span>
						</el-col>
						<el-col :span="8">
							<span>价格：</span>
							<span>{{orderDetail.price}}</span>
						</el-col>
						<el-col :span="8">
							<span>优惠券：</span>
							<span>{{orderDetail.discountMoney}}</span>
						</el-col>
						<el-col :span="8">
							<span>会员优惠：</span>
							<span>{{orderDetail.vipDiscount}}</span>
						</el-col>
						<el-col :span="8">
							<span>折扣：</span>
							<span>{{orderDetail.vipDiscount}}</span>
						</el-col>
						<el-col :span="8">
							<span>支付方式：</span>
							<span>{{orderDetail.payType}}</span>
						</el-col>
						<el-col :span="8">
							<span>赠送积分：</span>
							<span>{{orderDetail.total_integral}}</span>
						</el-col>
						<el-col :span="8">
							<span>实际支付：</span>
							<span>{{orderDetail.money}}</span>
						</el-col>
						<el-col :span="8">
							<span>支付状态：</span>
							<span>{{orderDetail.type}}</span>
						</el-col>
						<el-col :span="8">
							<span>下单时间：</span>
							<span>{{orderDetail.addtime}}</span>
						</el-col>
					</div>
				</el-card>
			</el-col>
		</el-row>

	</div>
</template>

<script>
	import http from 'assets/js/http.js'
	export default {
		components: {},
		data() {
			return {
				orderDetail: {}
			}
		},
		created() {
			this.id = this.$route.params.id
			this.TP = this.$route.params.TP

			console.log('this.id', this.id)
			console.log('this.TP', this.TP)

			const data = {
				'orderid': this.id,
				'TP': this.TP
			}
			this.$watch('$route', {
				deep: true,
				handler: function() {
					this.id = this.$route.params.id
					this.apiPost('/AdminApi/order/orderEdit', data).then(res => {
						console.log('详情data', data)
						this.handelResponse(res, data => {
							this.orderDetail = data
						})
					})
				}
			})
			this.apiPost('/AdminApi/order/orderEdit', data).then(res => {
				this.handelResponse(res, data => {
					console.log('详情data', data)
					this.orderDetail = data
				})
			})

		},
		methods: {

		},
		mixins: [http]
	}
</script>

<style scoped>
	.el-card__body .el-col {
		line-height: 2em;
	}
</style>